/**
 * @file HelpDialog.hpp
 */
#ifndef __HELPDIALOG_HPP__
#define __HELPDIALOG_HPP__

#include <qdialog.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qtextbrowser.h>
#include <qtreeview.h>

#include <defines.h>
#include <HelpConfigManager.hpp>

class HelpDialog : public QDialog {
	Q_OBJECT
	protected:
		QTextBrowser* _browser;
		QPushButton* _close;
		QLineEdit* _search;
		QPushButton* _show;
		QTreeView* _tree;

		bool _hasTree;
		HelpConfigManager* _config;
		QStringList _topics;

	public:
		HelpDialog(const string &config);
		virtual ~HelpDialog();

	protected:
		virtual void createTree();
		virtual void resetUrl();
		virtual void resizeEvent(QResizeEvent* event);
		virtual void showEvent(QShowEvent* event);

	public slots:
		virtual void changePage(const QModelIndex &index);
		virtual void changePage(const string &index);
		virtual void searchPage(const QString &pattern);
		virtual void showPage();

	signals:
};

#endif /* __HELPDIALOG_HPP__ */
